﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using emp.BLL;

public partial class crm_updatecamsstates : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button_click_0(object sender, EventArgs e)
    {
        Button button = (Button)sender;

        Questionnaire qu = new Questionnaire();

        string state = "0";

        if (String.IsNullOrEmpty(this.cam_id.Text))
        {
            this.msg.Text = "请输入活动代码！";
        }
        else
        {
            if (button.ID == "state_0")
            {
                state = "0";
            }
            else if (button.ID == "state_1")
            {
                state = "1";
            }
            else if (button.ID == "state_2")
            {
                state = "2";
            }

            if (qu.executesql("update campaign set cam_state='" + state + " ' where cam_uid=" + this.cam_id.Text) > 0)
            {
                this.msg.Text = "状态更新成功！";
            }
            else
            {
                this.msg.Text = "更新失败,请核对活动代码！";
            }
        }
    }
}
